arm: read/write rank->vcpu atomically
authorStefano Stabellini <sstabellini@kernel.org>
Sat, 11 Feb 2017 02:05:22 +0000 (18:05 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 16 Mar 2017 20:59:51 +0000 (13:59 -0700)
commitc75fe6473b73705c9b9f7d8ecc3d043afef55727
tree1a6bc63b577d2c840373c14f4e6ec0fc50bd51da
parentaf18ca94f3fdbea87687c07ba532269dbb483e64
arm: read/write rank->vcpu atomically

We don't need a lock in vgic_get_target_vcpu anymore, solving the
following lock inversion bug: the rank lock should be taken first, then
the vgic lock. However, gic_update_one_lr is called with the vgic lock
held, and it calls vgic_get_target_vcpu, which tries to obtain the rank
lock.

Coverity-ID: 1381855
Coverity-ID: 1381853

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vgic.c
xen/include/asm-arm/vgic.h